﻿using MongoDB.Bson.Serialization.Attributes;
using Sustainalytics.Entities.ESGRatings;
using System;
using MongoDB.Bson;
namespace Sustainalytics.Entities
{
    public enum FilterStatus
    {
        Draft,
        Active
    }

    public enum TargetType
    {
        Screening,
        Report
    }

    public enum ScreenRegion
    {
        SystemAndFavFilters,
        OtherFilters
    }

    public enum ExportType
    {
        Excel,
        CSV
    }

    /// <summary>
    /// initially RootFilter, now transformed to Filter for New Screening Tool
    /// </summary>
    [Serializable]
    public class Filter : IEntity
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        [BsonRepresentation(BsonType.String)]
        public FilterType Type { get; set; }
        public Guid OwnerUserId { get; set; }
        public Guid AccountId { get; set; }
        public DateTime? LastSaved { get; set; }
        public DateTime CreatedAt { get; set; }
        public bool IsFavorite { get; set; }
        [BsonRepresentation(BsonType.String)]
        public FilterStatus Status { get; set; }
        public DateTime? PublishDate { get; set; }
        public DateTime? UnPublishDate { get; set; }

        public Guid? PortfolioId { get; set; }
        public string PortfolioName { get; set; }

        public int? UniverseId { get; set; }
        public string UniverseName { get; set; }

        public Guid? PeerGroup { get; set; }
        public string PeerGroupName { get; set; }

        public Guid? Region { get; set; }
        public string RegionName { get; set; }

        public Guid? Country { get; set; }
        public string CountryName { get; set; }

        public CompanyTypeEnum? CompanyType { get; set; }
        public Guid? WeightMatrixId { get; set; }
        public string WeightMatrixName { get; set; }

        public Guid? ReferenceUniverseId { get; set; }
        public string ReferenceUniverseName { get; set; }

        public ComparativeGroupEnum? ComparativeGroup { get; set; }
        public int? CompanyTypePublicOrPrivate { get; set; }
        public int? ResearchType { get; set; }
        [BsonRepresentation(BsonType.String)]
        public TargetType TargetType { get; set; }
        [BsonRepresentation(BsonType.String)]
        public ExportType? ExportType { get; set; }
    }
}
